<?php 
include  "../../protegido/protected1.php"; /*Valida el inico de sesion*/
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Usuarios Profesor</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">

  <!--link rel="stylesheet/less" href="less/bootstrap.less" type="text/css" /-->
  <!--link rel="stylesheet/less" href="less/responsive.less" type="text/css" /-->
  <!--script src="js/less-1.3.3.min.js"></script-->
  <!--append ‘#!watch’ to the browser URL, then refresh the page. -->
  
  <link href="../../bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <link href="../../bootstrap/css/style.css" rel="stylesheet">
  

  <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
  <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
  <![endif]-->

  <!-- Fav and touch icons 
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../../bootstrap/img/apple-touch-icon-144-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../../bootstrap/img/apple-touch-icon-114-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../../bootstrap/img/apple-touch-icon-72-precomposed.png">
  <link rel="apple-touch-icon-precomposed" href="../../bootstrap/img/apple-touch-icon-57-precomposed.png">-->
  <link rel="shortcut icon" href="../../bootstrap/img/Limasys2.1.png">
  
  <script type="text/javascript" src="../../bootstrap/js/jquery.min.js"></script>
  <script type="text/javascript" src="../../bootstrap/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="../../bootstrap/js/scripts.js"></script>
  

  <!--importaciones para la tabla-->
<script src="../../tabla/media/js/jquery.js"></script>
        <script src="../../tabla/media/js/jquery.dataTables.js"></script>
        <link rel="stylesheet" type="text/css" href="../../tabla/media/css/demo_table.css">
        <link rel="stylesheet" type="text/css" href="../../tabla/media/css/jquery.dataTables_themeroller.css">
        
        <script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
                $('#datatables').dataTable();
            })
        </script>
        <!--fin de las importaciones para la tablas-->
        <!--Importacion del documento js para validar el formulario en la modal-->
        
        <script src="../../js/jquery.validate.js"></script>

        <script>
         $(document).ready(function() {
              $("#frmRegistrar").validate({
                rules: {
                  txtCedula: {required: true, minlength: 9, maxlength: 12},
                  txtNombres: {required: true, textva: true},
                  txtApellidos:{required: true, textva: true},
                  txtapellido2: {required: true, textva: true},
                  txtFechaNaci: {required: true, date: true},
                  txtSexo: {required: true, textva: true},
                  txtAsig: {required: true, textva: true},
                  txtCorreo: {required: true, email: true},
                  txtTelefono:  {required: true, number: true, minlength: 8, maxlength: 8}

                },
                messages: {
                  txtCedula : "Cedula Incorrecta: Formato, CR 9 Dijitos = 503900753. Nacionalizado 12 Dijitos= 155817672117",
                  txtNombres : "Nombre no Valido, No se aceptan Numeros",
                  txtApellidos : "Primer Apellido no Valido, No se aceptan Numeros",
                  txtapellido2 : "Segundo Apellido no Valido, No se aceptan Numeros",
                  txtFechaNaci : "Fecha no Valida, DD/MM/AAAA ",
                  txtSexo: "Genero no Valido, Se require: Hombre o Mujer, No se aceptan Numeros",
                  txtAsig: "Asignatura no valida, No se aceptan Numeros",
                  txtCorreo: "Correo no Valido, se requiere @ y .",
                  txtTelefono : "Telefono no Valido,  se require solo Numeros, Maximo 8 Digito"
                }
              });
            });
         //console.log(messages.txtCedula);
        </script>
        <style>
            .error-message, label.error {
                color: #ff0000;
                margin:0;
                display: inline;
                font-size: 1em !important;
                font-weight:lighter;
            }
        </style>


</head>

<body>
<div class="container-fluid">
  <div class="row clearfix">
    <div class="col-md-12 column ">
      <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"><!-- navbar-default acomoda el menu  //navbar-inverse navbar-fixed-top//-->
        <div class="navbar-header">
           <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button> <a class="navbar-brand" href="#">
             <a class="navbar-brand" href="index.html">
                         <img src="../../bootstrap/img/logo.png" alt="" />
                        </a>

           </a>
        </div>
        
        <div class="collapse navbar-collapse " id="bs-example-navbar-collapse-1">
          <ul class="nav navbar-nav ">
            <li>
              <a href="../../menuAdmin/index.html"><strong class="glyphicon glyphicon-list "></strong> Inicio</a>
            </li>
            <li class="dropdown active">
              <a href="#" class="dropdown-toggle btn btn-primary"  data-toggle="dropdown"> <strong class="glyphicon glyphicon-check"></strong> Usuarios<strong class="caret"></strong></a>
              <ul class="dropdown-menu">
                <li>
                  <a href="../administrador/index.php">Administrador</a>
                </li>
                <li class="divider"></li>
                <li >
                  <a href="../estudiante/index.php">Estudiante</a>
                </li>
                <li class="divider"></li>
                <li class="active">
                  <a href="index.php">Profesores</a>
                </li>
              </ul>
            </li>
            <li>
              <a href="../../libro/index.php"> <strong class="glyphicon glyphicon-book"></strong> Libro</a>
            </li>
            <li>
               <a href="../../prestamoLibros/index.php"> <strong class="glyphicon glyphicon-tags"></strong> Prestamo de Libro</a>
             
            </li>
            <li>
              <a href="../../BibliotecaVirtual/index.php"><strong class="glyphicon glyphicon-list-alt"></strong> Biblioteca Virtual</a>
            </li>
<!--
            <li>
              <a href="#"><strong class="glyphicon glyphicon-phone"></strong> Material Tecnologico</a>
            </li>
            <li>
              <a href="#"><strong class="glyphicon glyphicon-new-window"></strong> Prestamo Material Tecnologico</a>
            </li>
-->
            <li>
              <a href="../../Reportes/index.php"><strong class="glyphicon glyphicon-folder-open"></strong> Reportes</a>
            </li>
            <li>
              <a href="#"><strong class="glyphicon glyphicon-question-sign"></strong> Ayuda</a>
            </li>
          </ul>
          <!--<form class="navbar-form navbar-left" role="search">
            <div class="form-group">
              <input type="text" class="form-control">
            </div> <button type="submit" class="btn btn-default">Submit</button>
          </form>-->
          <ul class="nav navbar-nav navbar-right">
            <li>
              <a href="#"></a>
            </li>
            <li class="dropdown">
               <a href="#" class="dropdown-toggle" data-toggle="dropdown"><strong class="glyphicon glyphicon-user"></strong></a>
              <ul class="dropdown-menu dropdown-user">
               
                </li>
                <li>
                  <a href="../../Protegido/logoutAdmin.php">Salir</a>
                </li>
              </ul>
            </li>
          </ul>
        </div>
      </nav>




      <hr>
      <div class="page-header">
       <hr>
        <h3 align="center">
          Seccion Usuarios Profesor!
        </h3>
        <hr>

        <!-- Incluir Tabla aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -->
        <!-- aprendiendo ventana modallllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll -->
        <!-- Button trigger modal -->
        <button type="button" id="btnNuevo" name="btnNuevo" value="Agregar Nuevo Profesor" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
          Agregar Profesor
        </button>

        <!-- Modal -->
        <div class="modal fade" id="myModal" name="myModal"tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">Agregar Profesor</h4>
              </div>
              <div class="modal-body">
               <div id="formularioRegistrar" align="center">
                      <div id="procedimiento">
                      </div>
                      <fieldset style="display: inline;">
                          <legend>Registrar Nuevo Profesor</legend>
                      
                          <form action="guardar.php" name="frmRegistrar" id="frmRegistrar" method="post" onsubmit="return validacion()">
                              <table>
                            <tr>
                                <td>Cedula : </td>
                                <td>
                                    <input class="form-control" type="text" id="txtCedula" name="txtCedula" onPaste = "return false;" placeholder="Cedula" autocomplete="off" required>
                                </td>
                            
                            </tr>
                            <tr>
                                <td>Nombre : </td>
                                <td>
                                    <input placeholder="Nombre" autocomplete="off" class="form-control" type="text" id="txtNombres" name="txtNombres" onPaste = "return false;" required>
                                </td>

                            </tr>
                            <tr>
                                <td>Apellido 1 : </td>
                                <td>
                                    <input placeholder="Primer Apellido" autocomplete="off" class="form-control" type="text" id="txtApellidos" name="txtApellidos" onPaste = "return false;" required>
                                </td>
                            </tr>
                            <tr>
                                <td>Apellido 2 : </td>
                                <td>
                                    <input placeholder="Segundo Apellido" autocomplete="off" class="form-control" type="text" id="txtapellido2" name="txtapellido2" onPaste = "return false;" required>
                                </td>
                            </tr>
                            <tr>
                               <td >Fecha de Nacimiento :<span class="required" style="color:#64a34f;"> 
                               </td>
                               <td> 
                                <input class="form-control" type="date" id="txtFechaNaci" name="txtFechaNaci" onPaste = "return false;" required>

                               </td>
                             </tr>
                             <tr>
                                <td>Genero : </td>
                                <td>
                                    
                                    <select placeholder="Genero" autocomplete="off" class="form-control" type="text" id="txtSexo" name="txtSexo" onPaste = "return false;" required >
                                      <option>Ingrese un Genero</option>
                                      <option>Hombre</option>
                                       <option>Mujer</option>
                                       
                                    </select>
                                
                                </td>
                             
                                <tr>
                                <td>Asignatura : </td>
                             <td>
                                    
                                    <select placeholder="Asignatura" autocomplete="off" class="form-control" type="text" id="txtAsig" name="txtAsig" onPaste = "return false;" required >
                                      <option>Ingrese la asignatura</option>
                                      <option>Español</option>
                                       <option>Matematicas</option>
                                       <option>Sociales</option>
                                       <option>Civica</option>
                                       <option>Ciencias</option>
                                       <option>Ingles</option>
                                       <option>Especialidades</option>
                                       <option>Religion</option>
                                        <option>Talleres</option>
                                    </select>
                                
                                </td>

                            </tr>
                            <tr>
                              <tr>
                                <td>Correo Electronico : </td>
                                <td>
                                    <input placeholder="Correo" autocomplete="off" class="form-control" type="email" id="txtCorreo" name="txtCorreo" onPaste = "return false;" required>
                                </td>
                            </tr>
                            <tr>
                              <tr>
                              <tr>
                                <td>Telefono : </td>
                                <td>
                                    <input placeholder="Telefono" autocomplete="off" class="form-control" type="number" id="txtTelefono" name="txtTelefono" onkeypress="return onlyNumber(event);" onPaste = "return false;" required>
                                </td>
                            </tr>
                            <!--
                            <tr>
                                <td>Foto : </td>
                                <td>
                                    <input class="form-control" type="file" id="txtfoto" name="txtfoto" onPaste = "return false;" required>
                                </td>
                            </tr>
                               -->

                                <td>
                                <br>
                               </br>
                                    <input class="btn btn-primary" type="submit" id="btnProcesar" name="btnProcesar" value="Guardar Profesor">
                                </td>
                                <td>
                                <br>
                               </br>
                                    <input class="btn btn-primary" type="reset" name="btnBorrar" id="btnBorrar" value="Borrar Formulario">
                                </td>
                            </tr>
                            </table>
                    </form>
                </fieldset>
            </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" data-dismiss="modal" name="btnProcesar">Cerrar</button>
      </div>
    </div>
  </div>
</div>
           

<!-- FInS Ventana Modallllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll  -->
<!--la tabla para mostrar los usuarios-->

    <div>
        <div>
            <div class="table-responsive">
                
        <p>&nbsp;</p>
                <p>&nbsp;</p>
                    
                    <table id="datatables" class="table table-striped">
                      <thead>
                            <?php
                            include('../../tabla/conn/conn.php');  
                            echo "<tr>"; 
                            echo "<th>Cedula</th>"; 
                            echo "<th>Nombre</th>"; 
                            echo "<th>Apellido</th>"; 
                            echo "<th>Apellido 2</th>";
                            echo "<th>Fech Naci</th>";
                            echo "<th>Genero</th>";
                            echo "<th>Asignatura</th>";
                            echo "<th>Correo</th>";
                            echo "<th>Telefono</th>";
                            echo "<th>Estado</th>";
                            echo "<th>Contraseña</th>"; 
                            echo "<th>Mod</th>"; 
                            echo "<th>Eli</th>";   
                            echo "<th>Contra</th>";              
                            echo "</tr>"; 
                            ?>
                      </thead>
                      
                          <tbody>
                                <?php
                                $result = mysql_query("SELECT * FROM `ls_02_usuarios` where LS02TP='Profesor'") or trigger_error(mysql_error());
                                while($row = mysql_fetch_array($result))
                                {
                                    echo "</tr>";
                                    echo "<td valign='top'>". nl2br( $row['LS00IDUS']) .  "</td>";
                                    echo "<td valign='top'>" . nl2br( $row['LS03NB']) . "</td>";
                                    echo "<td valign='top'>" . nl2br( $row['LS04AP1']) . "</td>";
                                    echo "<td valign='top'>" . nl2br( $row['LS05AP2']) . "</td>";  
                                    echo "<td valign='top'>" . nl2br( $row['LS06FN']) . "</td>"; 
                                    echo "<td valign='top'>" . nl2br( $row['LS07GN']) . "</td>"; 
                                    echo "<td valign='top'>" . nl2br( $row['LS007ASG']) . "</td>"; 
                                    echo "<td valign='top'>" . nl2br( $row['LS10CR']) . "</td>";
                                    echo "<td valign='top'>" . nl2br( $row['LS11TLF']) . "</td>";
                                    echo "<td valign='top'>" . nl2br( $row['LS12ET']) . "</td>";
                                    echo "<td valign='top'>" . nl2br( $row['LS13CT']) . "</td>";  
                                                                            
                                    echo "<td valign='top'><a href=modificar.php?id={$row['LS00IDUS']}  data-toggle='popover' title='Modificar al Profesor'><span  class='glyphicon glyphicon-edit'></span></a></td>
                                    <td><a href=eliminar.php?id={$row['LS00IDUS']}  data-toggle='popover' title='Eliminar al Profesor'><span class='glyphicon glyphicon-trash'></span></a></td>               
                                    <td><a href=contrasena.php?id={$row['LS00IDUS']}  data-toggle='popover' title='Recuperar la Contraseña del Profesor'><span  class='glyphicon glyphicon-compressed'></span></a></td> 

                                     ";  
                                }
                                
                                mysql_close($link);
                                ?>
                          </tbody>
                    </table>
                        <p>&nbsp;</p>
                    </div>  
                    <p>&nbsp;</p>
                    </div>
            </div>

        </div>
           <!--fin de la tabla para mostrar los usuarios-->
    </div>
    
    </div>
  </div>

  </div>

<div class="footer_btm"><!-- start footer_btm -->
  <div class="container">
    <div class="navbar navbar-default">

       <a class="navbar-brand" >
                    <img class="img-rounded" align="left" src="../../bootstrap/img/barrainferios/limasys.png" alt="" />
                </a>
                <a class="navbar-brand" align="left">
                    <img <img class="img-rounded" align="left" src="../../bootstrap/img/barrainferios/ctp.png" alt="" />
                </a>

               <a class="navbar-brand" align="left">
                    <img <img class="img-rounded" align="left" src="../../bootstrap/img/barrainferios/una.png" alt="" />
                </a>


        <p class=""><span>&#169; Reservado todo los Derechos|2014| Diseñado por&nbsp;<a href="http://LYMASYS/"> Javier Villarreal y Josue Morales</a></span></p>
    </div>
  </div>
</div>
</body>
</html>
